package com.tv.nextin;

import com.tv.nextin.Utils.Utils;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

public class SplashScreenActivity extends Activity {
	
	TextView txt;
	Handler mHandler = new Handler();
	Runnable rMain;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash_screen);
		
		txt = (TextView) findViewById(R.id.txt_title);
	
		createRunable();
		
		setFont();
		mHandler.removeCallbacks(rMain);
		mHandler.postDelayed(rMain, 3000);
	}
	
	private void createRunable(){
		rMain = new Runnable() {
			
			@Override
			public void run() {
				gotoMain();
			}
		};
	}
	
	private void setFont(){
		txt.setTypeface(Utils.getTypefaceBlack(SplashScreenActivity.this));
	}
	
	private void gotoMain(){
		Intent t = new Intent(SplashScreenActivity.this, MainActivity.class);
		finish();
		startActivity(t);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		mHandler.removeCallbacks(rMain);
	}
	
	
	
}
